﻿using Infrastructure;
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SnowTech.SmartTms.App.Jobs
{
    public class EmployeeAnalysisJob : IJob
    {
        private SysLogApp _sysLogApp;
        private OpenJobApp _openJobApp;

        public EmployeeAnalysisJob(SysLogApp sysLogApp, OpenJobApp openJobApp)
        {
            _sysLogApp = sysLogApp;
            _openJobApp = openJobApp;
        }

        //具体要做的事情
        public Task Execute(IJobExecutionContext context)
        {
            var jobId = context.MergedJobDataMap.GetString(Define.JOBMAPKEY);

            //todo:这里可以加入自己的自动任务逻辑
            // 调用仓储 获取 今天入职的员工

            _openJobApp.RecordRun(jobId); //记录任务运行日志
            return Task.Delay(1);
        }
    }
}
